package com.example.controller;

import com.example.common.Page;
import com.example.common.PageQueryParam;
import com.example.entity.TSongListEntity;
import com.example.service.TSongListService;
import com.example.vo.SingListVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/tsonglist")
public class TSongListController {
    @Autowired
    private TSongListService tSongListService;

    @RequestMapping(value = "/create", method = RequestMethod.POST)
    public void create(@RequestBody(required = true)TSongListEntity tSongListEntity){
        tSongListService.create(tSongListEntity);
    }

    @RequestMapping(value = "/query",method = RequestMethod.POST)
    public Page<SingListVo> query(@RequestBody(required = true)PageQueryParam<TSongListEntity> pageQueryParam){
        return tSongListService.query(pageQueryParam);
    }

    @RequestMapping(value = "/delete", method = RequestMethod.POST)
    public Integer delete(@RequestBody(required = true)TSongListEntity tSongListEntity){
        return tSongListService.delete(tSongListEntity);
    }
}
